# 集計修飾子の例

これらの例は、[Sum - チャート関数](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/BasicAggregationFunctions/sum.htm#sum) 関数で作成されていますが、set 分析定義および total 修飾子をサポートするすべてのチャート集計関数に適用できます。

例1：

選択を行う前の論理的な状態を描写する、次のストレート テーブルの表示を見てください。

![Example table image of aggregation function with total qualifier](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/Resources/Images/ex_gen_aggregatequal1.png)

テーブルの例: 合計修飾子を使用した集計関数

| Month | Group | Sum(Value) | sum(total Value) | sum({1} total Value) |
| --- | --- | --- | --- | --- |
| - | - | 21 | 21 | 21 |
| 1 | A | 1 | 21 | 21 |
| 1 | B | 2 | 21 | 21 |
| 2 | A | 3 | 21 | 21 |
| 2 | B | 4 | 21 | 21 |
| 3 | A | 5 | 21 | 21 |
| 3 | B | 6 | 21 | 21 |

2 番目と 3 番目の数式列には、すべての行に同じ数値が含まれています。この数値は、最初の数式列の計算された合計になります。

ここでは、Month 1 と 2 だけを選択します。結果は次のようになります。

![Example table image of aggregation function with total qualifier filtered by month](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/Resources/Images/ex_gen_aggregatequal2.png)

テーブルの例: 合計修飾子を使用した集計関数、月別にフィルター

| Month (フィルター: 1～2) | Group | Sum(Value) | sum(total Value) | sum({1} total Value) |
| --- | --- | --- | --- | --- |
| - | - | 10 | 10 | 21 |
| 1 | A | 1 | 10 | 21 |
| 1 | B | 2 | 10 | 21 |
| 2 | A | 3 | 10 | 21 |
| 2 | B | 4 | 10 | 21 |

set 定義が 現在の選択を無視するため、3 番目 (5 列目) の数式の結果は変更されません。total 修飾子を含む 2 番目の数式列 (4 列目) には、新しい合計値 10 が表示されます。これは、最初の数式列 (3 列目) で計算された合計になります。

例2：

次のストレート テーブルの表示を見てください。

![Example table image of total qualifier with listed fields](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/Resources/Images/ex_gen_aggregatequal3.png)

テーブルの例: リストされた項目を使用した合計修飾子

| Month | Group | Sum(Value) | sum(total &lt;Month&gt; Value) | sum(total &lt;Group&gt; Value) |
| --- | --- | --- | --- | --- |
| - | - | 21 | 21 | 21 |
| 1 | A | 1 | 3 | 9 |
| 1 | B | 2 | 3 | 12 |
| 2 | A | 3 | 7 | 9 |
| 2 | B | 4 | 7 | 12 |
| 3 | A | 5 | 11 | 9 |
| 3 | B | 6 | 11 | 12 |

3 番目の数式列 (`sum(total<Month> Val)`) では、Month ごとに 1 つの合計が計算されます。

4 番目の数式列 (`sum(total<Grp> Val)`) では、group ごとに 1 つの合計が計算されます。

## 詳細を見る

* [set 分析および set 数式](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-analysis-expressions.htm)
* [ピボット テーブルの行の合計](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/NestedAggregations/sum-of-rows-pivot-tables.htm)
* [Aggr](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/aggr.htm "Aggr")